home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / LaserWriterIIsc (New GX v1.1) / UniversalMessageIntf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-20  |  3.3 KB  |  88 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     UniversalMessageIntf.h
  4.  
  5. DESCRIPTION
  6.     This module contains the constant and type declarations for the 
  7.     UniversalMessageIntf.c file.  That file contains the routines which override
  8.     the universal imaging messages that are supported by the LaserWriterSC
  9.     driver.
  10.     
  11. COPYRIGHT
  12.      Copyright Apple Computer, Inc. 1989-1993
  13.      All rights reserved. 
  14.     
  15. -------------------------------------------------------------------------------- */
  16.  
  17. #ifndef __UNIVERSALMESSAGEINTF__
  18. #define __UNIVERSALMESSAGEINTF__
  19.  
  20. /*********************************************************************************
  21.  *                                            CONSTANTS                                                *
  22.  *********************************************************************************/
  23.  
  24. #define kSilentError 3    /* Positive error code to suppress job failure alert. */
  25.  
  26. // Constants for knowing the max. limits of paper sizes 
  27. enum
  28. {
  29.     kMaxPageWidth            = ff(8 * 300),
  30.     kMaxLetterPageHeight    = ff(10 * 300 + 180),
  31.     kMaxA4PageHeight        = ff(11 * 300 + 75),
  32.     kMaxLegalPageHeight    = ff(12 * 300),
  33.     kMaxPaperWidth         = ff(8 * 300 + 150),
  34.  
  35.     kMinSCTopMargin        = 0x0076,            // minimum top margin supported by printer
  36.     kMinSCLeftMargin        = 0x000E,            // minimum left margin for 8.5" width
  37.     
  38.     kUSLetterWidth            = ff(8 * 72 + 36),
  39.     kUSLetterHeight        = ff(11 * 72),
  40.     
  41.     kUSLegalWidth            = ff(8 * 72 + 36),
  42.     kUSLegalHeight            = ff(14 * 72),
  43.     
  44.     kA4LetterWidth            = ff(8 * 72 + 18),
  45.     kA4LetterHeight        = 0x034800A8,
  46.     
  47.     kB5LetterWidth            = 0x01F300E0,
  48.     kB5LetterHeight        = 0x02C3FF58,
  49.     
  50.     kEnvelopeWidth            = ff(4 * 72 + 9),
  51.     kEnvelopeHeight        = ff(9 * 72 + 36)
  52. };
  53.     
  54.  
  55. /*********************************************************************************
  56.  *                                             TYPES                                                     *
  57.  *********************************************************************************/
  58.  
  59. // SpecGlobalsRec - Structure containing the LaserWriterSC's global variables 
  60.  
  61. typedef struct
  62. {
  63.     gxRasterImageDataHdl    hImageData;                    // image data for a page 
  64.     gxFormat                    pageFormat;                    // current page format we are printing 
  65.     short                        deviceNum;                    // SCSI device number of device we're connected to
  66.     short                        lastSCSIStatus;            //    last status returned from a call to SCSIComplete
  67.     long                        timeoutForSCSIComplete;    //    timeout in ticks to use in calls to SCSIComplete
  68.     short                        scsiCommand[3];            //    next SCSI command to execute
  69.     short                        drawbitsParams[5];        //    rectangle and transfer mode parameters used in the SC draw bits command
  70.     Boolean                    haveDrawBitsParams;        //    T => SD_CheckStatus routine has already received the DrawBits parameters;
  71.                                                                 //    This implies the data coming into SD_CheckStatus is the bitmap data
  72.     Boolean                    printedAPage;                //    T => driver has started printing a page;  F => driver hasn't yet printed a page 
  73.     gxFormat                    lastPageFormat;            // Format associated with the last page the driver printed
  74. }    SpecGlobalsRec,     
  75.     *SpecGlobalsPtr,      
  76.     **SpecGlobalsHdl;
  77.     
  78.     
  79. /*********************************************************************************
  80.  *                                            DEFINES                                                    *
  81.  *********************************************************************************/
  82.  
  83. #define kSpecGlobalsRecLen     sizeof(SpecGlobalsRec)
  84.  
  85. // F2S - for converting fixed numbers to shorts 
  86. #define F2S(a) FixedToInt(a)
  87.  
  88. #endif __UNIVERSALMESSAGEINTF__